<?php

/**
 * Description of Application_Model_Fields_Identifier
 *
 * @author Jean Brito
 */
class Application_Model_Fields_Identifier extends Application_Model_Fields_Abstract {
	
	protected $_sqlType='int';
	protected $_sqlSize=11;
	
	
	public function getSqlCreate(){
		return parent::getSqlCreate().' NOT NULL AUTO_INCREMENT, PRIMARY KEY ('.$this->getSqlFieldName().')';
	}
	
	public function getSqlSet($value=0){
		if($value!=''&&$value!=0)return "$value";
		return null;
	}
	
	public function setValue($value=0,$row=array()){
		$value=trim($value);
		if($value!=''&&$value!=0){
			return $value;
		}
		return $value;
	}
}
